from django.conf.urls.defaults import *
import travel

urlpatterns = patterns('travel.views',
                       (r'^travel/(?P<pid>\d+)/?$', 'index'),
                       (r'^travel/?$', 'index'),
                       )

# Generic Views
urlpatterns += patterns('django.views.generic.simple',
                       (r'^travel/latitude_longitude/(?P<location>[^/]*)/?$', 'direct_to_template', {'template': 'travel/latitude_longitude.dhtml'}),
                        (r'^travel/comments/add_comment/(?P<id>\d+)/$', 'direct_to_template', {'template': 'travel/comments/add_comment.dhtml'}),
                        (r'^travel/comments/show_comments/(?P<id>\d+)/$', 'direct_to_template', {'template': 'travel/comments/show_comments.dhtml'}),
                        )

## Media
from settings import BASE_PATH, DEBUG

import os.path
if DEBUG:
    urlpatterns += patterns('django.views.static',
        (r'^static/(?P<path>.*)$', 'serve', dict(
                document_root = os.path.join(BASE_PATH, 'static'),
                show_indexes = True,
            )
         ),)

    urlpatterns += patterns('travel.views', (r'^test/?$', 'test'),)
                            
#Feeds
from travel.feeds import LatestEntries, MyLatestComments
feeds = {
    'latest': LatestEntries,
    'comments' : MyLatestComments,
}
urlpatterns += patterns('django.contrib.syndication.views', (r'^feeds/travel/(?P<url>.*)/$', 'feed', {'feed_dict': feeds}), )

# Applications
urlpatterns += patterns('',
                        (r'^admin/', include('django.contrib.admin.urls')),
                        (r'^comments/', include('django.contrib.comments.urls.comments')),
                        )
